home *** CD-ROM | disk | FTP | other *** search
- //
- // FileSize
- //
- // syntaxe : (int) size = FileSize(char *Name_of_File)
- // return -1 if file does not exist
- //
- // Rodrigo REYES 1993
- //
-
- #include "proto/dos.h"
- #include "dos/dos.h"
- #include "dos/dosextens.h"
-
- int FileSize(char *);
-
- int FileSize(char *Name)
- {
- int taille=-1;
- struct FileLock *loq;
- struct FileInfoBlock bloq;
-
- loq = (struct FileLock*) Lock(Name,-2);
-
- if (loq)
- {
- Examine( (BPTR) loq,&bloq);
- taille = bloq.fib_Size;
-
- UnLock( (BPTR) loq);
- }
-
- return(taille);
- }
-
-